@inherits MiniRazor.TemplateBase<CodeModule>
@namespace OSharp.CodeGeneration.Templates
@using System;
@using System.Linq;
@using OSharp.CodeGeneration.Services.Entities
@using OSharp.CodeGeneration.Utils
@using OSharp.Collections;
@using OSharp.Exceptions;
@using OSharp.Extensions;
@{
  CodeModule module = Model;
  string lowerModule = module.Name.ToLowerCase();
  string urlModule = module.Name.UpperToLowerAndSplit();
}// -----------------------------------------------------------------------
//  <once-generated>
//     这个文件只生成一次，再次生成不会被覆盖。
//  </once-generated>
//
//  <copyright file="src/router/menus/modules/@(module.Name.UpperToLowerAndSplit()).ts" company="@module.Project.Company">
//      @module.Project.Copyright
//  </copyright>
//  <site>@module.Project.SiteUrl</site>
//  <last-editor>@module.Project.Creator</last-editor>
// -----------------------------------------------------------------------
import type { MenuModule } from '/@@/router/types';
import { t } from '/@@/hooks/web/useI18n';

const @lowerModule: MenuModule = {
  orderNo: @(module.Order * 10),
  menu: {
    path: '/@(urlModule)',
    name: t('routes.@(lowerModule).@(lowerModule)'),

    children: [
@foreach (var entity in module.Entities.OrderBy(m => m.Order))
{
  string urlEntity = entity.Name.UpperToLowerAndSplit();
  string lowerEntity = entity.Name.ToLowerCase();
  <text>      {
        path: '@(urlEntity)',
        name: t('routes.@(lowerModule).@(lowerEntity)')
      },
</text>
}
    ],
  },
};
export default @(lowerModule);

